<template>
	<view class="consult">
		<view class="swiptr" v-for="(item, index) in image">
			<image :src=" '/static/images/' + item.img + '.png' " mode=""></image>
		</view>
		<view class="consult-top" v-for="(item, index) in comment">
			<view class="consult-ul">
				<view class="consult-img">
					<image src="/static/images/huancun.png" ></image>
				</view>
				<view class="consult-title">
					<view class="consult-title-tele">
						<text>{{item.title}}</text>
					</view>
					<view class="consult-title-time">{{item.addtime}}</view>
				</view>
			</view>
			<view class="consult-ulw">
				<view class="consult-ulw-text">
					<text>{{item.content}}</text>
				</view>
				<view class="consult-ulw-img">
					<image :src=" 'http://hyk.weifangtianxia.com/' + val  " v-for="(val, index) in item.images"></image>
				</view>
			</view>
			<view class="consult-ulw-botomm">
				<view class="consult-img">
					<image src="../../static/images/zhuanfa.png" mode=""></image>
					<text>分享</text>
				</view>
				<view class="consult-img">
					<image src="../../static/images/chakan2.png" mode=""></image>
					<text>{{item.discuss}}</text>
				</view>
				<view class="consult-img">
					<image src="../../static/images/pinglun.png" mode=""></image>
					<text>{{item.examine}}</text>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				comment: [], //信息列表
				image:[
					{
						img:'',
					}
				]
			}
		},
		onLoad() {
			this.getList();
		},
		methods: {
			getList() {
				this.$get(this.api.companyList).then((res) => {
					console.log(res)
					this.comment = res.rows;
					this.processing();  //处理图片字符串转换为数组
				}).catch((err) => {
					console.log(err)
				})
			},
			//数据处理  图片字符串转换为数组
			processing() {
				for (let i = 0; i < this.comment.length; i++) {
					this.comment[i].images = this.comment[i].images.split(',');
					console.log(this.comment[i].images, "123")
				}
				console.log(this.comment, "this.comment")
			}
		}
	}
</script>

<style lang="less" scoped>
	.swiptr {
		width: 748rpx;
		height: 402rpx;
		border: 1rpx solid red;
		image{
			width: 748rpx;
			height: 402rpx;
		}
	}

	.consult-top {
		.consult-ul {
			display: flex;
			padding: 20rpx 20rpx;

			.consult-img {
				image {
					width: 64rpx;
					height: 64rpx;
					border-radius: 50%;
				}
			}

			.consult-title {
				height: 150rpx;
				padding: 0 20rpx;

				.consult-title-tele {
					width: 600rpx;
					height: 70rpx;
					font-size: 30rpx;
					font-family: Source Han Sans CN;
					font-weight: bold;
					color: #333333;
					line-height: 70rpx;
					overflow: hidden;
					white-space: nowrap;
					text-overflow: ellipsis;
				}

				.consult-title-time {
					height: 19rpx;
					font-size: 24rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #999999;
					line-height: 38rpx;
					padding: 15rpx 0;
				}
			}
		}

		.consult-ulw {
			width: 700rpx;
            margin: 0 auto;
			.consult-ulw-text {
				width: 601rpx;
				font-size: 26rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: #333333;
				line-height: 38rpx;
				margin: 0 auto;
			}

			.consult-ulw-img {
				display: flex;
				image {
					width: 282rpx;
					height: 282rpx;
					border: 1px solid #eee;
					border-radius: 8rpx;
					margin: 0 auto;
					margin-top: 20rpx;
				}
			}
		}

		.consult-ulw-botomm {
			display: flex;
			flex-direction: row-reverse;
			padding: 30rpx 30rpx;

			.consult-img {
				padding: 0 20rpx;
				image {
					width: 25rpx;
					height: 25rpx;
					padding: 0 10rpx;
				}
              text{
				  font-size: 24rpx;
				  font-family: Source Han Sans CN;
				  font-weight: 400;
				  color: #000000;
			  }
			}
		}
	}
</style>
